<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Platform Security Architecture — cryptography and keystore interface: Basic definitions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Platform Security Architecture — cryptography and keystore interface
   &#160;<span id="projectnumber">Working draft</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Basic definitions</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga4cc859e2c66ca381c7418db3527a65e1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga4cc859e2c66ca381c7418db3527a65e1">PSA_SUCCESS</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)0)</td></tr>
<tr class="separator:ga4cc859e2c66ca381c7418db3527a65e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga24d5fdcdd759f846f79d9e581c63a83f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga24d5fdcdd759f846f79d9e581c63a83f">PSA_ERROR_UNKNOWN_ERROR</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)1)</td></tr>
<tr class="separator:ga24d5fdcdd759f846f79d9e581c63a83f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1dcc6d130633ed5db8942257581b55dd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga1dcc6d130633ed5db8942257581b55dd">PSA_ERROR_NOT_SUPPORTED</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)2)</td></tr>
<tr class="separator:ga1dcc6d130633ed5db8942257581b55dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4d1b8dd8526177a15a210b7afc1accb1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga4d1b8dd8526177a15a210b7afc1accb1">PSA_ERROR_NOT_PERMITTED</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)3)</td></tr>
<tr class="separator:ga4d1b8dd8526177a15a210b7afc1accb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga695025f4ec11249aee7ea3d0f65e01c8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga695025f4ec11249aee7ea3d0f65e01c8">PSA_ERROR_BUFFER_TOO_SMALL</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)4)</td></tr>
<tr class="separator:ga695025f4ec11249aee7ea3d0f65e01c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac2fee3a51249fbea45360aaa911f3e58"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gac2fee3a51249fbea45360aaa911f3e58">PSA_ERROR_OCCUPIED_SLOT</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)5)</td></tr>
<tr class="separator:gac2fee3a51249fbea45360aaa911f3e58"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaba00e3e6ceb2b12965a81e5ac02ae040"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gaba00e3e6ceb2b12965a81e5ac02ae040">PSA_ERROR_EMPTY_SLOT</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)6)</td></tr>
<tr class="separator:gaba00e3e6ceb2b12965a81e5ac02ae040"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga933d40fa2a591004f2e93aa91e11db84"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga933d40fa2a591004f2e93aa91e11db84">PSA_ERROR_BAD_STATE</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)7)</td></tr>
<tr class="separator:ga933d40fa2a591004f2e93aa91e11db84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga798df25a505ebf931f7bec1f80f1f85f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga798df25a505ebf931f7bec1f80f1f85f">PSA_ERROR_INVALID_ARGUMENT</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)8)</td></tr>
<tr class="separator:ga798df25a505ebf931f7bec1f80f1f85f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga91b2ad8a867517a2651f1b076c5216e5"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga91b2ad8a867517a2651f1b076c5216e5">PSA_ERROR_INSUFFICIENT_MEMORY</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)9)</td></tr>
<tr class="separator:ga91b2ad8a867517a2651f1b076c5216e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga897a45eb206a6f6b7be7ffbe36f0d766"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga897a45eb206a6f6b7be7ffbe36f0d766">PSA_ERROR_INSUFFICIENT_STORAGE</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)10)</td></tr>
<tr class="separator:ga897a45eb206a6f6b7be7ffbe36f0d766"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5cdb6948371d49e916106249020ea3f7"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga5cdb6948371d49e916106249020ea3f7">PSA_ERROR_COMMUNICATION_FAILURE</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)11)</td></tr>
<tr class="separator:ga5cdb6948371d49e916106249020ea3f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadd169a1af2707862b95fb9df91dfc37d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gadd169a1af2707862b95fb9df91dfc37d">PSA_ERROR_STORAGE_FAILURE</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)12)</td></tr>
<tr class="separator:gadd169a1af2707862b95fb9df91dfc37d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga08b10e70fa5ff0b05c631d9f8f6b2c6b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga08b10e70fa5ff0b05c631d9f8f6b2c6b">PSA_ERROR_HARDWARE_FAILURE</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)13)</td></tr>
<tr class="separator:ga08b10e70fa5ff0b05c631d9f8f6b2c6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2c5dda1485cb54f2385cb9c1279a7004"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga2c5dda1485cb54f2385cb9c1279a7004">PSA_ERROR_TAMPERING_DETECTED</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)14)</td></tr>
<tr class="separator:ga2c5dda1485cb54f2385cb9c1279a7004"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4deb59fec02297ec5d8b42178323f675"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga4deb59fec02297ec5d8b42178323f675">PSA_ERROR_INSUFFICIENT_ENTROPY</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)15)</td></tr>
<tr class="separator:ga4deb59fec02297ec5d8b42178323f675"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga35927f755d232c4766de600f2c49e9f2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga35927f755d232c4766de600f2c49e9f2">PSA_ERROR_INVALID_SIGNATURE</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)16)</td></tr>
<tr class="separator:ga35927f755d232c4766de600f2c49e9f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabe29594edbfb152cf153975b0597ac48"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gabe29594edbfb152cf153975b0597ac48">PSA_ERROR_INVALID_PADDING</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)17)</td></tr>
<tr class="separator:gabe29594edbfb152cf153975b0597ac48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf1fa61f72e9e5b4a848c991bea495767"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#gaf1fa61f72e9e5b4a848c991bea495767">PSA_ERROR_INSUFFICIENT_CAPACITY</a>&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)18)</td></tr>
<tr class="separator:gaf1fa61f72e9e5b4a848c991bea495767"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf2edfe992db358f8eefd4bc82d069592"><td class="memItemLeft" align="right" valign="top"><a id="gaf2edfe992db358f8eefd4bc82d069592"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>PSA_BITS_TO_BYTES</b>(bits)&#160;&#160;&#160;(((bits) + 7) / 8)</td></tr>
<tr class="separator:gaf2edfe992db358f8eefd4bc82d069592"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga997f71feb68cca794f7ed676600e06db"><td class="memItemLeft" align="right" valign="top"><a id="ga997f71feb68cca794f7ed676600e06db"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>PSA_BYTES_TO_BITS</b>(bytes)&#160;&#160;&#160;((bytes) * 8)</td></tr>
<tr class="separator:ga997f71feb68cca794f7ed676600e06db"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga05676e70ba5c6a7565aff3c36677c1f9"><td class="memItemLeft" align="right" valign="top">typedef int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a></td></tr>
<tr class="memdesc:ga05676e70ba5c6a7565aff3c36677c1f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function return status.  <a href="#ga05676e70ba5c6a7565aff3c36677c1f9">More...</a><br /></td></tr>
<tr class="separator:ga05676e70ba5c6a7565aff3c36677c1f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2de150803fc2f7dc6101d5af7e921dd9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__basic.html#ga2de150803fc2f7dc6101d5af7e921dd9">psa_crypto_init</a> (void)</td></tr>
<tr class="memdesc:ga2de150803fc2f7dc6101d5af7e921dd9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Library initialization.  <a href="#ga2de150803fc2f7dc6101d5af7e921dd9">More...</a><br /></td></tr>
<tr class="separator:ga2de150803fc2f7dc6101d5af7e921dd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga933d40fa2a591004f2e93aa91e11db84"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga933d40fa2a591004f2e93aa91e11db84">&#9670;&nbsp;</a></span>PSA_ERROR_BAD_STATE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_BAD_STATE&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)7)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The requested action cannot be performed in the current state.</p>
<p>Multipart operations return this error when one of the functions is called out of sequence. Refer to the function descriptions for permitted sequencing of functions.</p>
<p>Implementations shall not return this error code to indicate that a key slot is occupied when it needs to be free or vice versa, but shall return <a class="el" href="group__basic.html#gac2fee3a51249fbea45360aaa911f3e58">PSA_ERROR_OCCUPIED_SLOT</a> or <a class="el" href="group__basic.html#gaba00e3e6ceb2b12965a81e5ac02ae040">PSA_ERROR_EMPTY_SLOT</a> as applicable. </p>

</div>
</div>
<a id="ga695025f4ec11249aee7ea3d0f65e01c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga695025f4ec11249aee7ea3d0f65e01c8">&#9670;&nbsp;</a></span>PSA_ERROR_BUFFER_TOO_SMALL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_BUFFER_TOO_SMALL&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)4)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>An output buffer is too small.</p>
<p>Applications can call the <code>PSA_xxx_SIZE</code> macro listed in the function description to determine a sufficient buffer size.</p>
<p>Implementations should preferably return this error code only in cases when performing the operation with a larger output buffer would succeed. However implementations may return this error if a function has invalid or unsupported parameters in addition to the parameters that determine the necessary output buffer size. </p>

</div>
</div>
<a id="ga5cdb6948371d49e916106249020ea3f7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5cdb6948371d49e916106249020ea3f7">&#9670;&nbsp;</a></span>PSA_ERROR_COMMUNICATION_FAILURE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_COMMUNICATION_FAILURE&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)11)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>There was a communication failure inside the implementation.</p>
<p>This can indicate a communication failure between the application and an external cryptoprocessor or between the cryptoprocessor and an external volatile or persistent memory. A communication failure may be transient or permanent depending on the cause.</p>
<dl class="section warning"><dt>Warning</dt><dd>If a function returns this error, it is undetermined whether the requested action has completed or not. Implementations should return <a class="el" href="group__basic.html#ga4cc859e2c66ca381c7418db3527a65e1">PSA_SUCCESS</a> on successful completion whenver possible, however functions may return <a class="el" href="group__basic.html#ga5cdb6948371d49e916106249020ea3f7">PSA_ERROR_COMMUNICATION_FAILURE</a> if the requested action was completed successfully in an external cryptoprocessor but there was a breakdown of communication before the cryptoprocessor could report the status to the application. </dd></dl>

</div>
</div>
<a id="gaba00e3e6ceb2b12965a81e5ac02ae040"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaba00e3e6ceb2b12965a81e5ac02ae040">&#9670;&nbsp;</a></span>PSA_ERROR_EMPTY_SLOT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_EMPTY_SLOT&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)6)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A slot is empty, but must be occupied to carry out the requested action.</p>
<p>If the slot number is invalid (i.e. the requested action could not be performed even after creating appropriate content in the slot), implementations shall return <a class="el" href="group__basic.html#ga798df25a505ebf931f7bec1f80f1f85f">PSA_ERROR_INVALID_ARGUMENT</a> instead. </p>

</div>
</div>
<a id="ga08b10e70fa5ff0b05c631d9f8f6b2c6b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga08b10e70fa5ff0b05c631d9f8f6b2c6b">&#9670;&nbsp;</a></span>PSA_ERROR_HARDWARE_FAILURE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_HARDWARE_FAILURE&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)13)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A hardware failure was detected.</p>
<p>A hardware failure may be transient or permanent depending on the cause. </p>

</div>
</div>
<a id="gaf1fa61f72e9e5b4a848c991bea495767"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf1fa61f72e9e5b4a848c991bea495767">&#9670;&nbsp;</a></span>PSA_ERROR_INSUFFICIENT_CAPACITY</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_INSUFFICIENT_CAPACITY&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)18)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The generator has insufficient capacity left.</p>
<p>Once a function returns this error, attempts to read from the generator will always return this error. </p>

</div>
</div>
<a id="ga4deb59fec02297ec5d8b42178323f675"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4deb59fec02297ec5d8b42178323f675">&#9670;&nbsp;</a></span>PSA_ERROR_INSUFFICIENT_ENTROPY</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_INSUFFICIENT_ENTROPY&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)15)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>There is not enough entropy to generate random data needed for the requested action.</p>
<p>This error indicates a failure of a hardware random generator. Application writers should note that this error can be returned not only by functions whose purpose is to generate random data, such as key, IV or nonce generation, but also by functions that execute an algorithm with a randomized result, as well as functions that use randomization of intermediate computations as a countermeasure to certain attacks.</p>
<p>Implementations should avoid returning this error after <a class="el" href="group__basic.html#ga2de150803fc2f7dc6101d5af7e921dd9" title="Library initialization. ">psa_crypto_init()</a> has succeeded. Implementations should generate sufficient entropy during initialization and subsequently use a cryptographically secure pseudorandom generator (PRNG). However implementations may return this error at any time if a policy requires the PRNG to be reseeded during normal operation. </p>

</div>
</div>
<a id="ga91b2ad8a867517a2651f1b076c5216e5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga91b2ad8a867517a2651f1b076c5216e5">&#9670;&nbsp;</a></span>PSA_ERROR_INSUFFICIENT_MEMORY</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_INSUFFICIENT_MEMORY&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)9)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>There is not enough runtime memory.</p>
<p>If the action is carried out across multiple security realms, this error can refer to available memory in any of the security realms. </p>

</div>
</div>
<a id="ga897a45eb206a6f6b7be7ffbe36f0d766"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga897a45eb206a6f6b7be7ffbe36f0d766">&#9670;&nbsp;</a></span>PSA_ERROR_INSUFFICIENT_STORAGE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_INSUFFICIENT_STORAGE&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)10)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>There is not enough persistent storage.</p>
<p>Functions that modify the key storage return this error code if there is insufficient storage space on the host media. In addition, many functions that do not otherwise access storage may return this error code if the implementation requires a mandatory log entry for the requested action and the log storage space is full. </p>

</div>
</div>
<a id="ga798df25a505ebf931f7bec1f80f1f85f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga798df25a505ebf931f7bec1f80f1f85f">&#9670;&nbsp;</a></span>PSA_ERROR_INVALID_ARGUMENT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_INVALID_ARGUMENT&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)8)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The parameters passed to the function are invalid.</p>
<p>Implementations may return this error any time a parameter or combination of parameters are recognized as invalid.</p>
<p>Implementations shall not return this error code to indicate that a key slot is occupied when it needs to be free or vice versa, but shall return <a class="el" href="group__basic.html#gac2fee3a51249fbea45360aaa911f3e58">PSA_ERROR_OCCUPIED_SLOT</a> or <a class="el" href="group__basic.html#gaba00e3e6ceb2b12965a81e5ac02ae040">PSA_ERROR_EMPTY_SLOT</a> as applicable. </p>

</div>
</div>
<a id="gabe29594edbfb152cf153975b0597ac48"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabe29594edbfb152cf153975b0597ac48">&#9670;&nbsp;</a></span>PSA_ERROR_INVALID_PADDING</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_INVALID_PADDING&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)17)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The decrypted padding is incorrect.</p>
<dl class="section warning"><dt>Warning</dt><dd>In some protocols, when decrypting data, it is essential that the behavior of the application does not depend on whether the padding is correct, down to precise timing. Applications should prefer protocols that use authenticated encryption rather than plain encryption. If the application must perform a decryption of unauthenticated data, the application writer should take care not to reveal whether the padding is invalid.</dd></dl>
<p>Implementations should strive to make valid and invalid padding as close as possible to indistinguishable to an external observer. In particular, the timing of a decryption operation should not depend on the validity of the padding. </p>

</div>
</div>
<a id="ga35927f755d232c4766de600f2c49e9f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga35927f755d232c4766de600f2c49e9f2">&#9670;&nbsp;</a></span>PSA_ERROR_INVALID_SIGNATURE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_INVALID_SIGNATURE&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)16)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The signature, MAC or hash is incorrect.</p>
<p>Verification functions return this error if the verification calculations completed successfully, and the value to be verified was determined to be incorrect.</p>
<p>If the value to verify has an invalid size, implementations may return either <a class="el" href="group__basic.html#ga798df25a505ebf931f7bec1f80f1f85f">PSA_ERROR_INVALID_ARGUMENT</a> or <a class="el" href="group__basic.html#ga35927f755d232c4766de600f2c49e9f2">PSA_ERROR_INVALID_SIGNATURE</a>. </p>

</div>
</div>
<a id="ga4d1b8dd8526177a15a210b7afc1accb1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4d1b8dd8526177a15a210b7afc1accb1">&#9670;&nbsp;</a></span>PSA_ERROR_NOT_PERMITTED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_NOT_PERMITTED&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)3)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The requested action is denied by a policy.</p>
<p>Implementations should return this error code when the parameters are recognized as valid and supported, and a policy explicitly denies the requested operation.</p>
<p>If a subset of the parameters of a function call identify a forbidden operation, and another subset of the parameters are not valid or not supported, it is unspecified whether the function returns <a class="el" href="group__basic.html#ga4d1b8dd8526177a15a210b7afc1accb1">PSA_ERROR_NOT_PERMITTED</a>, <a class="el" href="group__basic.html#ga1dcc6d130633ed5db8942257581b55dd">PSA_ERROR_NOT_SUPPORTED</a> or <a class="el" href="group__basic.html#ga798df25a505ebf931f7bec1f80f1f85f">PSA_ERROR_INVALID_ARGUMENT</a>. </p>

</div>
</div>
<a id="ga1dcc6d130633ed5db8942257581b55dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1dcc6d130633ed5db8942257581b55dd">&#9670;&nbsp;</a></span>PSA_ERROR_NOT_SUPPORTED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_NOT_SUPPORTED&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)2)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The requested operation or a parameter is not supported by this implementation.</p>
<p>Implementations should return this error code when an enumeration parameter such as a key type, algorithm, etc. is not recognized. If a combination of parameters is recognized and identified as not valid, return <a class="el" href="group__basic.html#ga798df25a505ebf931f7bec1f80f1f85f">PSA_ERROR_INVALID_ARGUMENT</a> instead. </p>

</div>
</div>
<a id="gac2fee3a51249fbea45360aaa911f3e58"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac2fee3a51249fbea45360aaa911f3e58">&#9670;&nbsp;</a></span>PSA_ERROR_OCCUPIED_SLOT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_OCCUPIED_SLOT&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)5)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A slot is occupied, but must be empty to carry out the requested action.</p>
<p>If the slot number is invalid (i.e. the requested action could not be performed even after erasing the slot's content), implementations shall return <a class="el" href="group__basic.html#ga798df25a505ebf931f7bec1f80f1f85f">PSA_ERROR_INVALID_ARGUMENT</a> instead. </p>

</div>
</div>
<a id="gadd169a1af2707862b95fb9df91dfc37d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadd169a1af2707862b95fb9df91dfc37d">&#9670;&nbsp;</a></span>PSA_ERROR_STORAGE_FAILURE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_STORAGE_FAILURE&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)12)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>There was a storage failure that may have led to data loss.</p>
<p>This error indicates that some persistent storage is corrupted. It should not be used for a corruption of volatile memory (use <a class="el" href="group__basic.html#ga2c5dda1485cb54f2385cb9c1279a7004">PSA_ERROR_TAMPERING_DETECTED</a>), for a communication error between the cryptoprocessor and its external storage (use <a class="el" href="group__basic.html#ga5cdb6948371d49e916106249020ea3f7">PSA_ERROR_COMMUNICATION_FAILURE</a>), or when the storage is in a valid state but is full (use <a class="el" href="group__basic.html#ga897a45eb206a6f6b7be7ffbe36f0d766">PSA_ERROR_INSUFFICIENT_STORAGE</a>).</p>
<p>Note that a storage failure does not indicate that any data that was previously read is invalid. However this previously read data may no longer be readable from storage.</p>
<p>When a storage failure occurs, it is no longer possible to ensure the global integrity of the keystore. Depending on the global integrity guarantees offered by the implementation, access to other data may or may not fail even if the data is still readable but its integrity canont be guaranteed.</p>
<p>Implementations should only use this error code to report a permanent storage corruption. However application writers should keep in mind that transient errors while reading the storage may be reported using this error code. </p>

</div>
</div>
<a id="ga2c5dda1485cb54f2385cb9c1279a7004"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2c5dda1485cb54f2385cb9c1279a7004">&#9670;&nbsp;</a></span>PSA_ERROR_TAMPERING_DETECTED</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_TAMPERING_DETECTED&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)14)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>A tampering attempt was detected.</p>
<p>If an application receives this error code, there is no guarantee that previously accessed or computed data was correct and remains confidential. Applications should not perform any security function and should enter a safe failure state.</p>
<p>Implementations may return this error code if they detect an invalid state that cannot happen during normal operation and that indicates that the implementation's security guarantees no longer hold. Depending on the implementation architecture and on its security and safety goals, the implementation may forcibly terminate the application.</p>
<p>This error code is intended as a last resort when a security breach is detected and it is unsure whether the keystore data is still protected. Implementations shall only return this error code to report an alarm from a tampering detector, to indicate that the confidentiality of stored data can no longer be guaranteed, or to indicate that the integrity of previously returned data is now considered compromised. Implementations shall not use this error code to indicate a hardware failure that merely makes it impossible to perform the requested operation (use <a class="el" href="group__basic.html#ga5cdb6948371d49e916106249020ea3f7">PSA_ERROR_COMMUNICATION_FAILURE</a>, <a class="el" href="group__basic.html#gadd169a1af2707862b95fb9df91dfc37d">PSA_ERROR_STORAGE_FAILURE</a>, <a class="el" href="group__basic.html#ga08b10e70fa5ff0b05c631d9f8f6b2c6b">PSA_ERROR_HARDWARE_FAILURE</a>, <a class="el" href="group__basic.html#ga4deb59fec02297ec5d8b42178323f675">PSA_ERROR_INSUFFICIENT_ENTROPY</a> or other applicable error code instead).</p>
<p>This error indicates an attack against the application. Implementations shall not return this error code as a consequence of the behavior of the application itself. </p>

</div>
</div>
<a id="ga24d5fdcdd759f846f79d9e581c63a83f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga24d5fdcdd759f846f79d9e581c63a83f">&#9670;&nbsp;</a></span>PSA_ERROR_UNKNOWN_ERROR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_ERROR_UNKNOWN_ERROR&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)1)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>An error occurred that does not correspond to any defined failure cause.</p>
<p>Implementations may use this error code if none of the other standard error codes are applicable. </p>

</div>
</div>
<a id="ga4cc859e2c66ca381c7418db3527a65e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4cc859e2c66ca381c7418db3527a65e1">&#9670;&nbsp;</a></span>PSA_SUCCESS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PSA_SUCCESS&#160;&#160;&#160;((<a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a>)0)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The action was completed successfully. </p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga05676e70ba5c6a7565aff3c36677c1f9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga05676e70ba5c6a7565aff3c36677c1f9">&#9670;&nbsp;</a></span>psa_status_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef int32_t <a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function return status. </p>
<p>This is either <a class="el" href="group__basic.html#ga4cc859e2c66ca381c7418db3527a65e1">PSA_SUCCESS</a> (which is zero), indicating success, or a nonzero value indicating that an error occurred. Errors are encoded as one of the <code>PSA_ERROR_xxx</code> values defined here. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga2de150803fc2f7dc6101d5af7e921dd9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2de150803fc2f7dc6101d5af7e921dd9">&#9670;&nbsp;</a></span>psa_crypto_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__basic.html#ga05676e70ba5c6a7565aff3c36677c1f9">psa_status_t</a> psa_crypto_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Library initialization. </p>
<p>Applications must call this function before calling any other function in this module.</p>
<p>Applications may call this function more than once. Once a call succeeds, subsequent calls are guaranteed to succeed.</p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga4cc859e2c66ca381c7418db3527a65e1">PSA_SUCCESS</a></td><td></td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga91b2ad8a867517a2651f1b076c5216e5">PSA_ERROR_INSUFFICIENT_MEMORY</a></td><td></td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga5cdb6948371d49e916106249020ea3f7">PSA_ERROR_COMMUNICATION_FAILURE</a></td><td></td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga08b10e70fa5ff0b05c631d9f8f6b2c6b">PSA_ERROR_HARDWARE_FAILURE</a></td><td></td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga2c5dda1485cb54f2385cb9c1279a7004">PSA_ERROR_TAMPERING_DETECTED</a></td><td></td></tr>
    <tr><td class="paramname"><a class="el" href="group__basic.html#ga4deb59fec02297ec5d8b42178323f675">PSA_ERROR_INSUFFICIENT_ENTROPY</a></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
